import request from '@/utils/request'

// 查询园区列表列表
export function listPark(query) {
  return request({
    url: '/system/park/list',
    method: 'get',
    params: query
  })
}

// 查询园区列表详细
export function getPark(parkId) {
  return request({
    url: '/system/park/' + parkId,
    method: 'get'
  })
}

// 上传park文件
export function uploadParkFile(data) {
  return request({
    url: '/common/upload',
    method: 'post',
    headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
    data: data
  })
}

// 新增园区列表
export function addPark(data) {
  return request({
    url: '/system/park',
    method: 'post',
    data: data
  })
}

// 修改园区列表
export function updatePark(data) {
  return request({
    url: '/system/park',
    method: 'put',
    data: data
  })
}

// 删除园区列表
export function delPark(parkId) {
  return request({
    url: '/system/park/' + parkId,
    method: 'delete'
  })
}

// 更新园区推荐状态
export function updateParkRecommend(parkId, isRecommend) {
  return request({
    url: `/system/park/${parkId}/recommend/${isRecommend}`,
    method: 'put'
  })
}
